package com.strato.serializer.xstream.v1_0_0.activator;

import java.util.HashMap;
import java.util.Map;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

import com.strato.base.osgi.v1_0_0.BundleUtil;
import com.strato.serializer.xstream.v1_0_0.impl.ObjectXStreamSerializer;

public class Activator implements BundleActivator {

	private static BundleContext context;

	@Override
	public void start(BundleContext arg0) throws Exception {
		context=arg0;
		ObjectXStreamSerializer serializer=new ObjectXStreamSerializer();
		Map<String, Object> props=new HashMap<String, Object>();
		props.put("id", "xstream");
		BundleUtil.exportServices(context, serializer, null, props);
	}

	@Override
	public void stop(BundleContext arg0) throws Exception {
		context=null;
	}

	public static BundleContext getContext() {
		return context;
	}

}
